﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Abp.AspNetCore;
using Abp.AspNetCore.SignalR;
using Abp.Modules;
using Abp.Reflection.Extensions;
using Abp.Timing;
using KelonProud.Data;
using KelonProud.Localization;

namespace KelonProud
{
    [DependsOn(typeof(AbpAspNetCoreModule), typeof(AbpAspNetCoreSignalRModule))]
    public class KelonProudModule: AbpModule
    {
        public override void PreInitialize()
        {
            //Clock.Provider = ClockProviders.Local;
            Configuration.Auditing.IsEnabledForAnonymousUsers = true;
            Configuration.EntityHistory.IsEnabled = true;
            //Configuration.Modules.AbpAspNetCore().DefaultWrapResultAttribute.WrapOnSuccess = false;


            // Declare entity types
            KelonProudLocalizationConfigurer.Configure(Configuration.Localization);

            // Enable this line to create a multi-tenant application.
            Configuration.MultiTenancy.IsEnabled = KelonProudConsts.MultiTenancyEnabled;
            // Configure roles

            CultureInfo.DefaultThreadCurrentCulture = CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("zh-CN");
        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(typeof(KelonProudModule).GetAssembly());
            DatabaseRegister.InitDataBase();
        }
    }
}
